// ml:run = $bin < input
#include <iostream>

using ll = long long;
ll a, b;

int main()
{
    std::ios_base::sync_with_stdio(false);
    int T; std::cin >> T;
    for (int ti = 1; ti <= T; ti++) {
        std::cout << "Case #" << ti << ":\n";
        std::cin >> a >> b;
        if (a == b) {
            std::cout << "1\n";
            std::cout << a << " " << b << "\n";
        } else {
            std::cout << "2\n";
            std::cout << a << " " << b << "\n";
            std::cout << b << " " << a << "\n";
        }
    }
}

